<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    *{
        margin: 0;
        padding: 0;
    }
    #box1{
        width: 100%;
        height: 900px;
        background: lawngreen;
    }
    #box2{
        width: 100%;
        height: 900px;
        background: blue;
    }
    #box3{
        width: 100%;
        height: 900px;
        background: yellow;
    }
    #box4{
        width: 50px;
        height: 50px;
        text-align: center;
        line-height: 25px;
        background: lightgoldenrodyellow;
        position: fixed;
        right: 0;
        bottom: 300px;
    }
</style>
<body>

    <p id="main">nihao</p>
    <a href="#box1">box1</a>
    <a href="#box2">box2</a>
    <a href="#box3">box3</a>
    <button id="but1">点击</button>
    <div id="box1"></div>
    <div id="box2"></div>
    <div id="box3"></div>
    <div id="box4"> <a href="#main"> 返回<br>顶部</a></div>

    <script>
        but1.onclick = function () {
            // console.log(window.open('https://gitee.com/he-guofeng/dashboard/projects?sort=&scope=&state='));
            console.log(window.innerHeight);
            console.log(window.innerWidth);
            console.log(window.location);
            console.log(window.location.hash);
            console.log(window.location.hosh);
            console.log(window.location.hostname);
            console.log(window.location.href);
            console.log(window.location.port);
            console.log(window.location.protocol);
            console.log(window.location.search);
            // console.log(window.location.reload());
            // window.location.replace('https://www.runoob.com/')



        }


    </script>

</body>
</html>